// (c)2016 Flipboard Inc, All Rights Reserved.

package net.onecloud.onecloud.application;

import android.app.Application;

import com.facebook.stetho.Stetho;

import net.onecloud.onecloud.model.Record;
import net.onecloud.onecloud.model.ResultRecord;
import net.onecloud.onecloud.model.ResultUser;

import java.util.ArrayList;
import java.util.List;

public class App extends Application {
    private static App INSTANCE;
    private static ResultUser.DataEntity user;

    private static List<ResultRecord.DataEntity> recordList = new ArrayList<>();

    public static App getInstance() {
        return INSTANCE;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        INSTANCE = this;

        Stetho.initialize(
                Stetho.newInitializerBuilder(this)
                        .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                        .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
                        .build());

    }

    public static ResultUser.DataEntity getUser() {
        return user;
    }

    public static void setUser(ResultUser.DataEntity user) {
        App.user = user;
    }

    public static List<ResultRecord.DataEntity> getRecordList() {
        return recordList;
    }

    public static void setRecordList(List<ResultRecord.DataEntity> recordList) {
        App.recordList = recordList;
    }
}
